<?php namespace Home\Controller; 

//测试控制器
class ContentController extends CommonController{

	//构造函数
	public function __init()
	{
	}
	
    //首页
    public function index(){

    	//获取点击的是哪一个aid
    	$aid = Q("get.aid",0,"intval");
		//文章数据
		$arcData = Db::table("article")->join("article_data","aid","=","article_aid")->where("aid",$aid)->first();
		//var_dump($arcData);
		//分离变量
		View::with("arcData",$arcData);
		$conf = array("title"=>$arcData['title']);
		//分离变量
		View::with("conf",$conf);
		//当前文章的标签
		$tags = Db::table("article_tag")->join("tag","tag_tid","=",'tid')->where("article_aid",$aid)->get();
		//var_dump($tags);
		//分配变量
		View::with("tags",$tags);
       View::make();
 
    }

}
